<template>
	
	<u-tabbar
		:value="value1"
		@change="change1"
		:placeholder="false"
		:fixed="true"
		:safeAreaInsetBottom="false"
	>
		<u-tabbar-item text="首页" icon="home" dot ></u-tabbar-item>
		<u-tabbar-item text="动态" icon="photo" badge="3"></u-tabbar-item>
		<u-tabbar-item text="消息" icon="play-right"></u-tabbar-item>
		<u-tabbar-item text="我的" icon="account"></u-tabbar-item>
	</u-tabbar>
	
</template>

<script>
	export default {
	    data() {
				return {
					value1:0
				}
		},
		methods:{
			change1(e) {
				
				this.value1 = e
				console.log('输出:', e);
				
				if(e==0){
					uni.reLaunch({
						url: '/pages/index/index'
					});
				}
				
				if(e==1){
					uni.reLaunch({
						url: '/pages/state/state'  
					});
				}
				
				if(e==2){
					uni.reLaunch({
						url: '/pages/message/message'
					});
				}
				
				if(e==3){
					uni.reLaunch({
						url: '/pages/my/my'
					});
				}
			}
		}
	}
</script>

<style lang="scss">
	.u-page {
		padding: 0;
		&__item {
			&__title {
				color: $u-tips-color;
				background-color: $u-bg-color;
				padding: 15px;
				font-size: 15px;

				&__slot-title {
					color: $u-primary;
					font-size: 14px;
				}
			}
			&__slot-icon {
				width: 17px;
				height: 17px;
			}
		}
	}
</style>
